package jw.repository.product;


import jw.model.product.WxProduct;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface WxProductRepository extends JpaRepository<WxProduct,Integer>, JpaSpecificationExecutor<WxProduct> {

    @Query("select p from WxProduct p where p.isNew =?1 and p.state = 1 order by p.createTime desc")
    List<WxProduct>findByIsNew(Integer isNew);

    List<WxProduct>findByTypeIdAndState(Integer typeId,Integer state);

    WxProduct findByNo(String no);
}
